package com.fc.mall.service;

import com.fc.mall.dto.*;
import com.fc.mall.dto.PmsGroupBuy;
import com.fc.mall.dto.PmsGroupBuyParam;
import com.fc.mall.dto.PmsGroupBuyReq;
import com.fc.mall.model.PmsProductGroupBuy;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 拼团管理Service
 * Created by dobuy on 2018/4/26.
 */
public interface PmsGroupBuyService {
    /**
     * 创建商品
     */
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    int create(PmsGroupBuyReq pmsGroupBuyReq);

    /**
     * 根据拼团编号获取更新信息
     */
    PmsGroupBuy getUpdateInfo(Long id);

    /**
     * 更新商品
     */
    @Transactional
    int update(Long id, PmsGroupBuyReq productGroupBuy);

    /**
     * 分页查询商品
     */
    List<PmsGroupBuy> list(PmsGroupBuyParam pmsGroupBuyParam, Integer pageSize, Integer pageNum);

    /**
     * 删除商品
     */
    int delete(Long ids);

    List<PmsProductGroupBuy> queryAllActiveGroupBuysByProductId(Long productId);
}
